﻿<div class="bjui-pageHeader">
    <form id="pagerForm" data-toggle="ajaxsearch" action="${request.getContextPath()}/dwsScrap/dwsScrapList" method="post">
        <div class="bjui-searchBar">
            <g:hiddenField name="SYS_QUERY_NAME" value="dwsScrapList" />
            <g:hiddenField name="EXPORT_CONTENT_NAME" value="Excel" />
            <label>产品名称：</label>
            <input name='part_name' value="${part_name}"/>

            <label>工单号：</label>
            <input name="woId" value="${woId}"/>
           <label>报废开始时间<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="startTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd"
                   size="18" id="start-date-input" readonly value="${startTime.format('yyyy-MM-dd')}">&nbsp;
            <label>报废结束时间<strong><span class="text-danger">*</span></strong>：</label>
            <input type="text" name="endTime" class="form-control"
                   data-toggle="datepicker" data-pattern="yyyy-MM-dd"
                   size="18" id="end-date-input" readonly value="${endTime.format('yyyy-MM-dd')}" >&nbsp;
            <button type="submit" class="btn-default" data-icon="search">查询</button>&nbsp;
            <button type="button" class="btn-blue" onclick="javascript:bjuiExportExl('#pagerForm','${request.getContextPath()}/boetv/exportExcel')" data-icon="file-excel-o" title="导出Excel">导出Excel文件</button>&nbsp;
        </div>
    </form>
</div>
<div class="bjui-pageContent">
    <div style="margin:15px auto 0; width:96%;">
        <div class="row" style="padding: 0 8px;">
            <div class="col-md-12">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h3 class="panel-title"><i class="fa fa-line-chart fa-fw"></i>Scrap Chart</h3>
                    </div>
                    <div class="panel-body">
                        <div style="mini-width:400px;height:450px;" id="dwsScrapDiv"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div style="margin:15px auto 0; width:96%;">
        <div class="row" style="padding: 0 8px;">
            <div class="col-md-12" id="glassOutReportTable">
                <g:if test="${dataListNo.size()>0}">
                    <table data-toggle="tablefixed" data-width="100%" data-nowrap="true">
                        <thead>
                        <tr>
                            <th width="110" align="center">工单号</th>
                            <th width="50" align="center">产品名称</th>
                            <th width="50" align="center">报废数量</th>
                            <th width="110" align="center">报废日期</th>
                        </tr>
                        </thead>
                        <tbody>
                        <g:each in="${dataListNo}" status="i" var="dataInstance">
                            <tr>
                                <td>${dataInstance.SCRAP_WO_ID}</td>
                                <td>${dataInstance.SCRAP_PRAT_NAME}</td>
                                <td><a data-toggle="navtab" data-id="scrap-navtab-form" data-title="ScrapDetailReport" href="${request.getContextPath()}/scrapWip/scrapWip?startTime=${startTime.format('yyyy-MM-dd HH:mm:ss')}&endTime=${endTime.format('yyyy-MM-dd HH:mm:ss')}">${dataInstance.SCRAP_QTY}</a></td>

                                <td>${dataInstance.SCRAP_TIME}</td>

                            </tr>
                        </g:each>
                        </tbody>
                    </table>
                </g:if>
            </div>
        </div>
    </div>
</div>
<g:render template="../template/pagination" />

<script src="${resource(dir: 'js/echarts', file: 'echarts.js')}" type="text/javascript"/>
<script src="${resource(dir: 'js/echarts', file: 'echarts-tool.js')}" type="text/javascript"/>
<script type="text/javascript">
    $(function () {
        var contextPath = "${request.getContextPath()}";
        eChartsTool.init(contextPath);
        var theme = 'shine';
        var stackText = 'Group';
        var rotateValue = 45;

        var typeData = [];
        var legendData = [];
        %{--<g:each in="${legendDataList}">--}%
        %{--legendData.push('${it}');--}%
        %{--if(${percentItemList.contains(it)}){--}%
//            typeData.push('line');
//        }else{
            typeData.push('bar');
//        }
        %{--</g:each>--}%

        var yAxisData = [''];

        var xAxisData = [];
        <g:each in="${dayList}">
        xAxisData.push('${it}');
        </g:each>

        var seriesData = ${seriesData};

        eChartsTool.init(contextPath);
        var monthOption = eChartsTool.initTwoyAxisOption(legendData, xAxisData, seriesData, typeData, yAxisData, rotateValue);
        var montChart = document.getElementById("dwsScrapDiv");
        eChartsTool.setOption(theme, montChart, monthOption);
/*
        $.CurrentNavtab.find('#start-date-input,#end-date-input').datetimepicker({
            format:'yyyy-mm-dd hh',
            autoclose: true,
            todayBtn: true,
            startView:1,
            minView:1,
            pickerPosition: "bottom-left",
            language:'zh-CN',
            startDate:'2016-01-01'
        });

        $.CurrentNavtab.find('.selectpicker').selectpicker();
		*/
    })
</script>